-
Notifications
You must be signed in to change notification settings - Fork 985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: remove old wallet signals and move signals to status-im ns #18285
Conversation
@@ -0,0 +1,20 @@ | |||
(ns status-im.contexts.wallet.signals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should I just put this in a regular effects file? not sure if we have a common approach for this but seemed nice to me to somewhat separate it out 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A separate ns is good as the signals for the wallet will grow over time. 👍
Jenkins BuildsClick to see older builds (52)
|
@@ -0,0 +1,20 @@ | |||
(ns status-im.contexts.wallet.signals |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A separate ns is good as the signals for the wallet will grow over time. 👍
(js->clj event-js | ||
:keywordize-keys | ||
true)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The js->clj
method from utils.transforms
is easy to use and has the extra :keywordize-keys
config handled.
:keywordize-keys | ||
true)) | ||
"wallet" (rf/dispatch [:wallet/signal-fired | ||
(js->clj event-js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know the shape of wallet signals or how frequently they may arrive, but if they come frequently enough it may be better to delay the js->clj transformation. That is, leave the decision up to the re-frame event that will actually deal with the signal. Maybe some signals won't require further processing, this is common in many cases, but I don't know about wallet signals, so I can't comment much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that's a good point, there is lots of unused wallet signals. will do 👍
"blockNumber" blockNumber | ||
"accounts" accounts) | ||
(case type | ||
"wallet-owned-collectibles-filtering-done" {:fx [[:dispatch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the structure you guys are applying to isolate wallet signals within the wallet
context 👍🏼 Good example to follow.
(rf/reg-event-fx | ||
:wallet/signal-fired | ||
(fn [_ {:keys [type blockNumber accounts] :as event}] | ||
(log/debug "[wallet-subs] new-wallet-event" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more idiomatic to log with a data structure. Just one suggestion:
(log/debug "New wallet event"
{:type type
:block-number blockNumber
:accounts accounts})
"wallet-owned-collectibles-filtering-done" {:fx [[:dispatch | ||
[:wallet/owned-collectibles-filtering-done | ||
event]]]} | ||
"wallet-get-collectibles-details-done" {:fx [[:dispatch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the signal name is long, we can avoid the line breaks added by zprint by moving the value below the map key.
(case type
"wallet-owned-collectibles-filtering-done"
{:fx [[:dispatch [:wallet/owned-collectibles-filtering-done event]]]}
"wallet-get-collectibles-details-done"
{:fx [[:dispatch [:wallet/get-collectible-details-done event]]]}
(log/debug ::unknown-wallet-event :type type :event event))
869153e
to
b6bda31
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice @J-Son89 !
I like the way we are organizing this! 💯
dc0116f
to
bbf6a82
Compare
bbf6a82
to
f9aa7f2
Compare
2a834ba
to
2d88610
Compare
88% of end-end tests have passed
Failed tests (4)Click to expandClass TestDeepLinksOneDevice:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Expected to fail tests (2)Click to expandClass TestCommunityMultipleDeviceMergedTwo:
Class TestCommunityOneDeviceMerged:
Passed tests (42)Click to expandClass TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestActivityMultipleDevicePRTwo:
Class TestCommunityMultipleDeviceMerged:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestActivityMultipleDevicePR:
Class TestCommunityOneDeviceMerged:
|
@J-Son89 @VolodLytvynenko after this one #18679 will be merged we will need to rebase this PR . Then Volodymyr will proceed with testing. |
Perfect, |
{:type event-type | ||
:block-number blockNumber | ||
:accounts accounts}) | ||
(case event-type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{:fx [[
is redundant i guess,{:dispatch []}
can be used directly
"pending-transaction-status-changed" {:fx | ||
[[:dispatch | ||
[:wallet/pending-transaction-status-changed-received | ||
(js->clj event-js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have transformations namespace, so it should be used
dcb40f5
to
dff256d
Compare
Hi @J-Son89 thank you for PR. No issues from my side. PR is ready to be merged |
@flexsurfer - thanks for the feedback. This pr was needed for some other work to go in and has been QA'd. |
8328a16
to
7541fce
Compare
The legacy wallet signals are not in use for the app. To clean things up I have removed them and kept the signals we are currently using in new wallet.
With that I also moved this file to contexts/wallet/signals - not sure about signals.cljs file name but perhaps it’s something we should consider as maybe it is slightly different than a regular effect?
**Testing notes:**
This pr does not change any functionality. It is just removing some unused code and moving some files.
It is worth testing that all previous wallet collectibles functionality is working correctly. Other than that there should be no specific affected area.